const Mock = require('mockjs');
const data = Mock.mock({
        'list|20': [{
            title: '@ctitle(2,4)',
            id: '@id',
            'children|3-5': [{
                img: '@image(100x100,@color)',
                id: '@id',
                title: '@ctitle(2,4)',
                'price|1-10': 0,
                num: 0,
                'sales|10-1000': 0,
                isCheck: false
            }]
        }],
        'classify|20': [{
            title: '@ctitle(2,4)',
            img: '@image(100x100,@color)',
            id: '@id'
        }]
    })
    // console.log(data.list);

// console.log(data);

module.exports = {
    devServer: {
        before(app) {
            app.get('/list', (req, res) => {
                    res.send(data.list)
                })
                // app.get('/classifyList', (req, res) => {
                //     res.send(data.classify)
                // })
        }
    }
}